<template>
  <div class="help">
    <el-collapse v-model="activeNames" accordion>
      <el-collapse-item title="如何给网站捐钱" name="1">
        <div>这里是答案</div>
      </el-collapse-item>
      <el-collapse-item title="如何购买两只猫" name="2">
        <div>不能购买两只猫</div>
      </el-collapse-item>
      <el-collapse-item title="如何联系当地的医院" name="3">
        <div>这里是答案</div>
      </el-collapse-item>
      <el-collapse-item title="绝育前能够配种吗" name="4">
        <div>这里是答案</div>
      </el-collapse-item>
    </el-collapse>
    <div class="button">
      <el-button type="success" @click="open1" plain>已解决</el-button>
      <el-button type="danger" @click="open2" plain>未解决</el-button>
      <el-button
        type="info"
        plain
        icon="el-icon-edit"
        @click="dialogFormVisible = true"
        >意见反馈</el-button
      >
      <el-dialog title="意见反馈" v-model="dialogFormVisible">
        <el-form :model="form">
          <el-form-item label="为我们评分" :label-width="formLabelWidth">
            <el-rate v-model="value"></el-rate>
          </el-form-item>
          <el-form-item label="意见或建议" :label-width="formLabelWidth">
            <el-input
              type="textarea"
              :rows="3"
              placeholder="请输入内容"
              v-model="textarea"
            >
            </el-input>
          </el-form-item>
        </el-form>
        <template #footer>
          <span class="dialog-footer">
            <el-button @click="dialogFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="dialogFormVisible = false"
              >提 交</el-button
            >
          </span>
        </template>
      </el-dialog>
    </div>
  </div>
</template>

<script>
import { defineComponent } from "vue";
import { ElMessage } from "element-plus";
export default defineComponent({
  data() {
    return {
      value: "",
      textarea: "",
      dialogTableVisible: false,
      dialogFormVisible: false,
      formLabelWidth: "100px",
    };
  },
  setup() {
    return {
      open1() {
        ElMessage.success({
          message: "已收到您的反馈",
          type: "success",
        });
      },
      open2() {
        ElMessage.error("已收到您的反馈");
      },
    };
  },
});
</script>

<style lang="less" scoped>
.help {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  height: 100%;
}
.el-collapse {
  margin-top: 10px;
  width: 80%;
  .el-collapse-item {
    border: 2px rgb(121, 125, 134) solid;
    margin-bottom: 10px;
    border-radius: 5px;
  }
  .el-collapse-item__header {
    font-size: 20px;
    padding-left: 5px;
    color: rgb(255, 0, 106);
  }
  .el-collapse-item__content {
    font-size: 15px;
    padding-left: 5px;
    padding-right: 5px;
  }
  .button {
    display: flex;
  }
}
</style>